﻿using DigitalHealth.PACS.Appointment.Models;
using DigitalHealth.PACS.Appointment.Repositories.Imp;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;

namespace DigitalHealth.PACS.Appointment.Controllers
{
    /// <summary>
    /// 预约信息
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class AppointInfoController : ControllerBase
    {
        public static List<AppointmentInfo> appointmentInfos = new List<AppointmentInfo>()
        {
            new AppointmentInfo()
            {
                classOrder=ClassOrderRepository._classOrderList.FirstOrDefault(),
                appointSlot=new  TimeSlot(){beginDateTime=DateTime.Now,endDateTime=DateTime.Now},
                CanAppointCount=500
            }
        };
        [HttpGet("ClassOrder/{classOrderId}")]
        public List<AppointmentInfo> GetAppointmentInfosByClassOrder(string classOrderId)
        {
            Console.WriteLine($"预约信息请求--{Guid.NewGuid()}");
            return appointmentInfos.Where(a=>a.classOrder.Id.ToString()==classOrderId).ToList();
        }
    }
}
